import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XyywShopForm, XyywShopQuery, XyywShopVo } from '@/api/xyyw/model/shopModel';
import { request } from '@/utils/request';

// 查询商铺列表
export function listShop(query?: XyywShopQuery) {
  return request.get<TableDataInfo<XyywShopVo>>({
    url: '/xyyw/shop/list',
    params: query,
  });
}

// 查询商铺详细
export function getShop(shopId: number) {
  return request.get<R<XyywShopVo>>({
    url: `/xyyw/shop/${shopId}`,
  });
}

// 新增商铺
export function addShop(data: XyywShopForm) {
  return request.post<R<void>>({
    url: '/xyyw/shop',
    data,
  });
}

// 修改商铺
export function updateShop(data: XyywShopForm) {
  return request.put<R<void>>({
    url: '/xyyw/shop',
    data,
  });
}

// 删除商铺
export function delShop(shopIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xyyw/shop/${shopIds}`,
  });
}
